<!--根页面组件的父组件,保存着登录的各种状态,所有的根页面需混合该页面，随时获取登陆状态-->
<template>
</template>
<script>
  export default {
    data() {
      return {}
    },
    components: {},
    mounted() {
      this.$store.commit("chageLoginState");
    },
    computed: {
      user_id() {
        return this.$store.state.userId;
      },

      user_key() {
        return this.$store.state.userKey;
      },

      agent_id() {
        return this.$store.state.agentId;
      },

      login_state() {
        let userId = this.$store.state.userId;
        let userKey = this.$store.state.userKey;
        let agentId = this.$store.state.agentId;
        if (this.$utils.isEmpty(userId) || this.$utils.isEmpty(userKey) || this.$utils.isEmpty(agentId)) {
          return false;
        }
        return true;//已登录
      }
    },
    watch: {},

    beforeRouteLeave(to, from, next) {
      next();
    },

    methods: {}
  }
</script>
<style>
</style>
